{% extends "base.html" %}
{% load url from future %}

{% block content %}
{% if user.is_authenticated %}
    <p>Welcome, {{ user.username }}.</p>
	<p><input class='btn' type="button" value="Logout" onClick="document.location.href='/logout';" /></p>
{% else %}
	{% if form.errors %}
		<p>Your username and password didn't match. Please try again.</p>
	{% else %}
		<h2>Please log in.</h2>
	{% endif %}

	<form method="post" action="{% url "django.contrib.auth.views.login" %}">
	{% csrf_token %}
	<table>
	<tr>
	    <td>{{ form.username.label_tag }}</td>
	    <td>{{ form.username }}</td>
	</tr>
	<tr>
	    <td>{{ form.password.label_tag }}</td>
	    <td>{{ form.password }}</td>
	</tr>
	</table>

	<input class='btn' type="submit" value="Log in" />
	<input type="hidden" name="next" value="{{ next }}" />
	</form>
{% endif %}
{% endblock %}
